import { request } from "@/utils/service"

// 默认加载3级指标树
export function treeWithLevels() {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/treeWithLevels",
    method: "post"
  })
}

// 加载子节点树
export function nodeLoading(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/nodeLoading",
    method: "post",
    data: data
  })
}

// 分页查询指标列表
export function nodePage(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/nodePage",
    method: "post",
    data: data
  })
}

// 保存为草稿
export function saveAsDraft(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/saveAsDraft",
    method: "post",
    data: data
  })
}

// 指标历史记录
export function historicalRecords(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/historicalRecords",
    method: "post",
    data: data
  })
}

// 指标报批申请单
export function applyMetrics(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/applyMetrics",
    method: "post",
    data: data
  })
}

// 指标报批申请单提交
export function submitApply(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/submitApply",
    method: "post",
    data: data
  })
}

// 审批申请历史
export function applyHistory(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/applyHistory",
    method: "post",
    data: data
  })
}

// 申请历史详情
export function applyHistoryDetails(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/applyHistoryDetails",
    method: "post",
    data: data
  })
}

// 撤销(作废)审批
export function revokeInvalid(data) {
  return request({
    url: "/sjw_department_control/cockpitMetricsTree/revokeInvalid",
    method: "post",
    data: data
  })
}
